/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package umled.model;

import java.util.*;
/**
 *
 * @author ANor
 */
public class TestModel {
    public static UMLModel getTestModel(){
        UMLModel model = new UMLModel( "GraphicsEditor", 0, 0, 400, 400 );
        UMLPackage modelPack = new UMLPackage( "GEModel", model, 10, 10, 50, 50 ); 
        UMLClass myShape = new UMLClass( "MyShape", modelPack, 20, 10, 30, 30, UMLVisible.PUBLIC );
        UMLClass integer = new UMLClass( "int", model, 0, 0, 0, 0, UMLVisible.PUBLIC );
        UMLClass string = new UMLClass( "String", model, 0, 0, 0, 0, UMLVisible.PUBLIC );
        UMLClass _void = new UMLClass( "void", model, 0, 0, 0, 0, UMLVisible.PUBLIC );
        UMLClass Graphics = new UMLClass( "Graphics", model, 0, 0, 0, 0, UMLVisible.PUBLIC );
        UMLMethod getName = new UMLMethod( "getName", myShape, 0, 0, 0, 0, UMLVisible.PUBLIC,
                integer, null, false, false );
        List<UMLType> types = new ArrayList<UMLType>();
        types.add( Graphics );
        UMLMethod draw = new UMLMethod( "draw", myShape, 0, 0, 0, 0, UMLVisible.PUBLIC,
                _void , types, false, true );
        UMLData name = new UMLData( "name", myShape, 0, 0, 0, 0, UMLVisible.PUBLIC, string , "");
        UMLClass myLine = new UMLClass( "MyLine", modelPack, 20, 10, 30, 30, UMLVisible.PUBLIC );
        myLine.addBaseType( myShape );
        
        myShape.addData( name );
        myShape.addMethod( getName );
        myShape.addMethod( draw );
        
        modelPack.addType( myLine );
        modelPack.addType( myShape );
        model.addPackage( modelPack );
        
        
        return model;
    }
}
